package TankCampaignGame.com.sjw.Game;

public class Tank {
    private int x;
    private int y;
    private int direct;
    private int speed = 5;

    public Tank(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public int getDirect() {
        return direct;
    }

    public void setDirect(int direct) {
        this.direct = direct;
    }

    public void moveUp(){
        this.y -= this.speed;
    }
    public void moveDown(){
        this.y += this.speed;
    }
    public void moveRight(){
        this.x += this.speed;
    }
    public void moveLeft(){
        this.x -= this.speed;
    }

    //子弹
    public void bulletMove(){
        while(true){
            if(this.y <= 0){
                break;
            }
            this.y -= speed;
        }
    }
}
